package cn.leo.dynamic_multi_datasource.datasource;

import cn.leo.dynamic_multi_datasource.datasource.DynamicDatasourceContextHolder;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @author leo.z.l
 * @create 2019-09-06  16:35
 */
public class DynamicRoutingDataSource extends AbstractRoutingDataSource {
    @Override
    protected Object determineCurrentLookupKey() {
        return DynamicDatasourceContextHolder.getDataSourceType();
    }
}
